package com.whc.api.client;

import com.whc.api.client.fallback.PayClientFallback;
import com.whc.api.config.DefaultFeignConfig;
import com.whc.api.dto.PayApplyDTO;
import com.whc.common.domain.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


//@RequestMapping("/client/pay")
@FeignClient(value = "pay-service",configuration = DefaultFeignConfig.class,
        fallbackFactory = PayClientFallback.class)
public interface PayClient {
    @PostMapping("/client/pay/addPay")
    Result addPay(@RequestBody PayApplyDTO payApplyDTO);

    @DeleteMapping("/client/pay/deletePay")
    Result deletePay(@RequestParam("payId") Long payId);

    //修改支付单为已支付
    @PutMapping("/client/pay/toPay")
    Result toPay(@RequestParam("payId") Long payId);

    @GetMapping("/client/pay/selectPayIdByOrderNumber")
    Result<Integer> selectPayByOrderId(@RequestParam("orderNumber") Long orderNumber);

}
